package cn.iocoder.yudao.module.bpm.dal.mysql.overdue;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.bpm.controller.admin.overdue.vo.OverdueReminderLogPageReqVO;
import cn.iocoder.yudao.module.bpm.dal.dataobject.overdue.OverdueReminderLogDO;
import org.apache.ibatis.annotations.Mapper;

/**
 * 流程逾期提醒记录 Mapper
 *
 * @author 韩佳乐
 */
@Mapper
public interface OverdueReminderLogMapper extends BaseMapperX<OverdueReminderLogDO> {

    default PageResult<OverdueReminderLogDO> selectPage(OverdueReminderLogPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<OverdueReminderLogDO>()
                .eqIfPresent(OverdueReminderLogDO::getProcInstId, reqVO.getProcInstId())
                .eqIfPresent(OverdueReminderLogDO::getReminderRunning, reqVO.getReminderRunning())
                .eqIfPresent(OverdueReminderLogDO::getReminderCount, reqVO.getReminderCount())
                .eqIfPresent(OverdueReminderLogDO::getReminderStatus, reqVO.getReminderStatus())
                .eqIfPresent(OverdueReminderLogDO::getReason, reqVO.getReason())
                .betweenIfPresent(OverdueReminderLogDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(OverdueReminderLogDO::getId));
    }

}